home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
lang_c
/
mc51bugs
/
q32770
< prev
next >
Wrap
Text File
|
1988-10-20
|
1KB
|
36 lines
Q32770 Incorrect Code for Complicated Switch Statement
C Compiler
5.10 | 5.10
MS-DOS | OS/2
Summary:
The code generated for a specific source file that contained a switch
block of 10 cases, with a statement within each case containing a
dereferenced pointer to a struct with variable indexed char array
members, generates incorrect when the code is compiled with large
model.
The code that is generated uses the lea instruction in circumstances
where it should be using the les instruction. (The code is large and
complicated and is not included here.)
Microsoft has confirmed this to be a problem in Version 5.10. We
are researching this problem and will post new information as it
becomes available. Two possible workarounds are described below.
More Information:
In some cases, a MOV BX, addr is generated rather than a LES BX, addr.
The problem is that the ES register is not preserved over function
calls, so using ES for addressing will be incorrect if ES has changed.
Changing from -Ox optimization to -Od eliminates the problem. The
problem can also be eliminated with careful (trial-and-error) use of
temporary variables. Check the generated code with CodeView before
using it.
Keywords: buglist5.10
Updated 88/10/21 03:46